import { BroadCastCall } from "../../broadCast/BroadCastCall";
import { MessageBlock } from "../../../../../Framework/MQ/MessageBlock";
import { SEntityId } from "../../../../../Message/Public/SEntityId";
import { EntityUtil } from "../../../scene/layer/utils/EntityUtil";
import { NetDispatcher } from "../../../../mvc/core/NetDispatcher";
import { ServerCommand } from "../../../mvc/ServerCommand";
//class GuildGroupDisbandCommand
    
    export  class GuildGroupDisbandCommand extends BroadCastCall
    {
        constructor(arg1: Object)
        {
            super(arg1);
            return;
        }

        public /* override */ call(arg1: MessageBlock): void
        {
            var loc3=null;
            var loc4=null;
            var loc1=arg1.messageBase as SEntityId;
            var loc2=_cache.guildElite.guildGroupDic;
            var loc5=0;
            var loc6=loc2;
            for(loc4 of loc6) 
            {
                if (!EntityUtil.equal(loc1, loc4.guildGroupId)) 
                {
                    continue;
                }
                loc3 = loc4;
                _cache.guildElite.deleteGuildGroup(loc4);
                break;
            }
            NetDispatcher.dispatchCmd(ServerCommand.GuildGroup_Disband, loc3);
            NetDispatcher.dispatchCmd(ServerCommand.GuildGroup_PlayerChange, null);
            return;
        }
    }
